var a = getApp();

Page({
    data: {
        last_page: 1,
        current_page: 1,
        info: {},
        list_data: [],
        love_name: "",
        point_name: "",
        grand_love: "",
        grand_point: ""
    },
    onLoad: function(a) {
        this.getData();
    },
    getData: function() {
        var t = this;
        a._postNetWork({
            url: a.getNetAddresss("plugin.subscription.frontend.modules.award.controllers.records.index"),
            success: function(e) {
                if (e.data.result) {
                    var n = e.data.data;
                    t.setData({
                        list_data: n.page_list.data,
                        love_name: n.love_name || "爱心值",
                        point_name: n.point_name,
                        grand_love: n.grand_love,
                        grand_point: n.grand_point,
                        last_page: n.page_list.last_page
                    });
                } else a.tips(e.data.msg);
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        var t = this;
        if (this.data.current_page >= this.data.last_page) return !1;
        var e = this.data.current_page + 1;
        a._postNetWork({
            url: a.getNetAddresss("plugin.subscription.frontend.modules.award.controllers.records.index"),
            data: {
                page: e
            },
            success: function(e) {
                e.data.result ? t.setData({
                    list_data: t.data.list_data.concat(e.data.data.page_list.data),
                    last_page: e.data.data.page_list.last_page,
                    current_page: e.data.data.page_list.current_page
                }) : a.tips(e.data.msg);
            }
        });
    },
    onShareAppMessage: function() {}
});